package com.xianchengchi2;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/**
 * @author: LCG
 * 作者: LCG
 * 日期: 2021/2/25  13:06
 * 描述:
 */
public class TestXianchengChi2 {
    public static void main(String[] args) {

       // ExecutorService executorService = Executors.newFixedThreadPool(2);

        ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(1);

        MyRunable2 myRunable2 = new MyRunable2();

        //scheduledExecutorService.scheduleAtFixedRate(myRunable2,5,1,TimeUnit.SECONDS);


        scheduledExecutorService.scheduleWithFixedDelay(myRunable2,5,3,TimeUnit.SECONDS);

        System.out.println("===============");


    }
}
